package com.indexingsystem.system.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.indexingsystem.boss.Vo.ProductIndexingVersionGetReqVo;
import com.indexingsystem.boss.admin.mapper.IdxProductIndexingVersionMapper;
import com.indexingsystem.boss.common.PagedResult;
import com.indexingsystem.boss.entity.IdxProductIndexingVersion;
import com.indexingsystem.boss.utils.BeanUtils;
import com.indexingsystem.system.service.IdxProductIndexingVersionService;
@Service
public class IdxProductIndexingVersionServiceImpl   implements IdxProductIndexingVersionService{

	@Resource
	private IdxProductIndexingVersionMapper idxProductIndexingVersionMapper;
	
	@Override
	public int deleteByPrimaryKey(String versionId) {
		return idxProductIndexingVersionMapper.deleteByPrimaryKey( versionId );
	}

	@Override
	public int insert(IdxProductIndexingVersion record) {
		return idxProductIndexingVersionMapper.insert( record );
	}

	@Override
	public int insertSelective(IdxProductIndexingVersion record) {
		return idxProductIndexingVersionMapper.insertSelective( record );
	}

	@Override
	public IdxProductIndexingVersion selectByPrimaryKey(String versionId) {
		return idxProductIndexingVersionMapper.selectByPrimaryKey( versionId );
	}

	@Override
	public int updateByPrimaryKeySelective(IdxProductIndexingVersion record) {
		return idxProductIndexingVersionMapper.updateByPrimaryKeySelective( record );
	}

	@Override
	public int updateByPrimaryKeyWithBLOBs(IdxProductIndexingVersion record) {
		return idxProductIndexingVersionMapper.updateByPrimaryKeyWithBLOBs( record );
	}

	@Override
	public int updateByPrimaryKey(IdxProductIndexingVersion record) {
		return idxProductIndexingVersionMapper.updateByPrimaryKey( record );
	}

	@Override
	public PagedResult<IdxProductIndexingVersion> getProductIndexingVersionList(
			ProductIndexingVersionGetReqVo productIndexingVersionGetReqVo) {
		 Integer pageNo = productIndexingVersionGetReqVo.getPageNo() == null ? 1 : productIndexingVersionGetReqVo.getPageNo();
	        Integer pageSize = productIndexingVersionGetReqVo.getPageSize() == null ? 10 : productIndexingVersionGetReqVo.getPageSize();
	        // startPage是告诉拦截器说我要开始分页了。分页参数是这两个。
	        PageHelper.startPage( pageNo, pageSize );
	        return BeanUtils.toPagedResult( idxProductIndexingVersionMapper.getProductIndexingVersionList( productIndexingVersionGetReqVo ) );
	}

	@Override
	public Integer getProductIndexingVersionListCount(ProductIndexingVersionGetReqVo productIndexingVersionGetReqVo) {
		// TODO Auto-generated method stub
		return idxProductIndexingVersionMapper.getProductIndexingVersionListCount( productIndexingVersionGetReqVo );
	}
	

}
